/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: LIUYANJIAO
 * Date: 2024-09-25
 * Time: 21:44
 */
public class Main {
    public static void func(String password) throws Exception{
        //判断密码是否正确，不正确则抛出异常
        if(!password.equals("llll")){
            throw new Exception("密码错误");
        }

    }
    public static void main(String[] args) throws Exception {
       //异常的声明
        func("lll");
    }
}